﻿namespace Magic.System;

#region 输入

/// <summary>
/// Admin分页输入
/// </summary>
public class SysUserPageInput
{
    /// <summary>
    /// 用户名 
    /// 默认值: 
    ///</summary>
    public string Username { get; set; }
    /// <summary>
    /// 昵称 
    /// 默认值: 
    ///</summary>
    public string Nickname { get; set; }
    /// <summary>
    /// 邮箱 
    /// 默认值: 
    ///</summary>       
    public string Email { get; set; }
    /// <summary>
    /// 手机 
    /// 默认值: 
    ///</summary>
    public string Mobile { get; set; }
    /// <summary>
    /// 
    /// </summary>

    public string quick_search { get; set; }

    public TimeRange LastLoginTime { get; set; }

    public TimeRange CreateTime { get; set; }

    /// <summary>
    /// 状态 0-禁用 1-正常
    /// </summary>
    public StatusEnum? Status { get; set; }
}

/// <summary>
/// 新增输入类
/// </summary>
public class AddSysUserInput
{
    /// <summary>
    /// 用户名
    /// </summary>
    [Required(ErrorMessage = "用户名不能为空")]
    public string Username { get; set; }
    /// <summary>
    /// 昵称
    /// </summary>
    [Required(ErrorMessage = "昵称不能为空")]
    public string Nickname { get; set; }
    /// <summary>
    /// 头像
    /// </summary>
    public string Avatar { get; set; }
    /// <summary>
    /// 邮箱 
    /// 默认值: 
    ///</summary>  
    [Required(ErrorMessage = "邮箱不能为空")]
    public string Email { get; set; }
    /// <summary>
    /// 手机 
    /// 默认值: 
    ///</summary>
    [Required(ErrorMessage = "手机号不能为空")]
    public string Mobile { get; set; }
    /// <summary>
    /// 状态:0=禁用,1=启用 
    /// 默认值: 1
    ///</summary>
    public StatusEnum Status { get; set; } = StatusEnum.Enabled;
    /// <summary>
    /// 角色组
    /// </summary>
    public string[] group_arr { get; set; }
    [Required(ErrorMessage = "密码不能为空")]
    public string Password { get; set; }
}
/// <summary>
/// 编辑输入类
/// </summary>
public class EditSysUserInput
{
    [Required(ErrorMessage = "Id不能为空")]
    public int id { get; set; }
    /// <summary>
    /// 用户名
    /// </summary>
    [Required(ErrorMessage = "用户名不能为空")]
    public string Username { get; set; }
    /// <summary>
    /// 昵称
    /// </summary>
    [Required(ErrorMessage = "昵称不能为空")]
    public string Nickname { get; set; }
    /// <summary>
    /// 头像
    /// </summary>
    public string Avatar { get; set; }
    /// <summary>
    /// 邮箱 
    /// 默认值: 
    ///</summary>  
    [Required(ErrorMessage = "邮箱不能为空")]
    public string Email { get; set; }
    /// <summary>
    /// 手机 
    /// 默认值: 
    ///</summary>
    [Required(ErrorMessage = "手机号不能为空")]
    public string Mobile { get; set; }
    /// <summary>
    /// 密码
    /// </summary>
    public string Password { get; set; }
    /// <summary>
    /// 状态:0=禁用,1=启用 
    /// 默认值: 1
    ///</summary>
    public StatusEnum Status { get; set; } = StatusEnum.Enabled;
    /// <summary>
    /// 角色组
    /// </summary>
    public string[] group_arr { get; set; }
}
#endregion

#region 输出
public class SysUserPageItem
{
    /// <summary>
    /// ID 
    ///</summary>
    public int Id { get; set; }
    /// <summary>
    /// 用户名 
    /// 默认值: 
    ///</summary>
    public string Username { get; set; }
    /// <summary>
    /// 昵称 
    /// 默认值: 
    ///</summary>
    public string Nickname { get; set; }
    /// <summary>
    /// 头像 
    /// 默认值: 
    ///</summary>
    public string Avatar { get; set; }
    /// <summary>
    /// 邮箱 
    /// 默认值: 
    ///</summary>
    public string Email { get; set; }
    /// <summary>
    /// 手机 
    /// 默认值: 
    ///</summary>
    public string Mobile { get; set; }
    /// <summary>
    /// 登录失败次数 
    /// 默认值: 0
    ///</summary>
    public byte Loginfailure { get; set; }
    /// <summary>
    /// 登录时间 
    ///</summary>
    public long Lastlogintime { get; set; }
    /// <summary>
    /// 登录IP 
    ///</summary>
    public string Lastloginip { get; set; }
    /// <summary>
    /// 签名 
    /// 默认值: 
    ///</summary>
    public string Motto { get; set; }
    /// <summary>
    /// 创建时间 
    ///</summary>
    public long Createtime { get; set; }
    /// <summary>
    /// 更新时间 
    ///</summary>
    public long Updatetime { get; set; }
    /// <summary>
    /// 状态:0=禁用,1=启用 
    /// 默认值: 1
    ///</summary>
    public StatusEnum Status { get; set; }
    /// <summary>
    /// 角色组Id数组
    /// </summary>
    public int[] group_arr { get; set; }
    /// <summary>
    /// 角色组名数组
    /// </summary>
    public string[] group_name_arr { get; set; }
}

public class SysUserDetailOutput
{
    /// <summary>
    /// ID 
    ///</summary>
    public int Id { get; set; }
    /// <summary>
    /// 用户名 
    /// 默认值: 
    ///</summary>
    public string Username { get; set; }
    /// <summary>
    /// 昵称 
    /// 默认值: 
    ///</summary>
    public string Nickname { get; set; }
    /// <summary>
    /// 头像 
    /// 默认值: 
    ///</summary>
    public string Avatar { get; set; }
    /// <summary>
    /// 邮箱 
    /// 默认值: 
    ///</summary>
    public string Email { get; set; }
    /// <summary>
    /// 手机 
    /// 默认值: 
    ///</summary>
    public string Mobile { get; set; }
    /// <summary>
    /// 登录失败次数 
    /// 默认值: 0
    ///</summary>
    public byte Loginfailure { get; set; }
    /// <summary>
    /// 登录时间 
    ///</summary>
    public int? Lastlogintime { get; set; }
    /// <summary>
    /// 登录IP 
    ///</summary>
    public string Lastloginip { get; set; }
    /// <summary>
    /// 签名 
    /// 默认值: 
    ///</summary>
    public string Motto { get; set; }
    /// <summary>
    /// 创建时间 
    ///</summary>
    public int? Createtime { get; set; }
    /// <summary>
    /// 更新时间 
    ///</summary>
    public int? Updatetime { get; set; }
    /// <summary>
    /// 状态:0=禁用,1=启用 
    /// 默认值: 1
    ///</summary>
    public StatusEnum Status { get; set; }
    /// <summary>
    /// 角色组Id数组
    /// </summary>
    public int[] group_arr { get; set; }
    /// <summary>
    /// 角色组名数组
    /// </summary>
    public string[] group_name_arr { get; set; }
}
#endregion

